package cn.lyq.card.ui.device

import android.widget.ImageView
import cn.lyq.card.R
import cn.lyq.card.data.model.DeviceInfo
import cn.lyq.card.utils.loadUrl
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder


class DeviceAdapter : BaseQuickAdapter<DeviceInfo, BaseViewHolder>
    (R.layout.item_device, mutableListOf()) {

    override fun convert(holder: BaseViewHolder, item: DeviceInfo) {
        holder.getView<ImageView>(R.id.imgDevice).loadUrl(item.img)
        holder.setText(R.id.tvName, "机具类型：${item.title ?: ""}")
        holder.setText(R.id.tvPrice, "机具价格：${item.price ?: ""}元/台")
    }

}